package com.qf.fc.controller;



import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qf.fc.Param.CommentAdd;
import com.qf.fc.Param.ReplayAdd;
import com.qf.fc.dto.CommentDto;
import com.qf.fc.entity.Comment;
import com.qf.fc.service.CommentService;
import com.qf.fc.vo.R;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;

/**
 * 评论表(Comment)表控制层
 *
 * @author makejava
 * @since 2024-09-23 23:34:44
 */
@RestController
@RequestMapping("/api/comment/")
@Tag(name = "评论接口") //knife4j 接口文档
public class CommentController {
    /**
     * 服务对象
     */
    @Resource
    private CommentService service;

    @PostMapping("add")
    public R<String> addComment(@RequestBody CommentAdd add){
        return service.add(add);
    }
    @PostMapping("replay")
    public R<String> addReplay(@RequestBody ReplayAdd add){
        return service.addReplay(add);
    }
    @GetMapping("my")
    public R<Comment> myComments(Integer uid){
        return service.queryMy(uid);
    }

    @GetMapping("page")
    public R<CommentDto> pageComments(Integer mid, Integer page, Integer size,Integer uid){
        return service.queryComments(mid,page,size,uid);
    }

}

